package ar.edu.unq.mongodbexample.model;

import java.util.List;

import com.google.code.morphia.annotations.Entity;
import com.google.code.morphia.annotations.Id;
import com.google.code.morphia.annotations.Reference;

/**
 * Representa una Universidad
 * 
 * @author Nicolas Faure
 */
@Entity(value = "University")
public class Univertity {

    @Id
    private String name;

    @Reference(concreteClass = java.util.Vector.class)
    private List<Professor> professors;
    
    @Reference(concreteClass = java.util.Vector.class)
    private List<Student> students;
    
    @Reference(concreteClass = java.util.Vector.class)
    private List<Career> careers;

    public Univertity() {

    }

    /**
     * CappaHernan
     */

    public Univertity(String name,List<Career> careers,List<Professor> professors,List<Student> students) {
        this.name = name;
        this.setCareers(careers);
        this.setProfessors(professors);
        this.setStudents(students);
    }

    public String getName() {
        return this.name;
    }

    /**
     * 
     * @param newVal
     */
    public void setName(final String newVal) {
        this.name = newVal;
    }

	public List<Professor> getProfessors() {
		return professors;
	}

	public void setProfessors(List<Professor> professors) {
		this.professors = professors;
	}

	public List<Student> getStudents() {
		return students;
	}

	public void setStudents(List<Student> students) {
		this.students = students;
	}

	public List<Career> getCareers() {
		return careers;
	}

	public void setCareers(List<Career> careers) {
		this.careers = careers;
	}
	
	public void addCareers(Career career) {
		this.careers.add(career);
	}
	public void addStudents(Student student) {
		this.students.add(student);
	}
	public void addProfessors(Professor professor) {
		this.professors.add(professor);
	}

}